﻿namespace MoskvaFM
{
    public class MskStationSource : IStationSource
    {
        private readonly DocumentFormatter documentFormatter;

        public MskStationSource(DocumentFormatter documentFormatter)
        {
            this.documentFormatter = documentFormatter;
        }

        public string DisplayName
        {
            get
            {
                return "МСК";
            }
        }

        public string FormatDocument(string id, string time)
        {
            return documentFormatter.FormatDocument("<div id='flashPlace'></div>",
                                            string.Format(@"
<script type='text/javascript' src='http://css.moskva.fm/js/swfobject.pack.js?v=20111118124631'></script>
<script type='text/javascript' language='JavaScript'>
swfobject.embedSWF('http://www.moskva.fm/f/MoskvaPlayer.swf?20111118124631', 'flashPlace', 474, 400, '10.0.0', '',
{{station: '{0}', time: '{1}', load: 'all', servertime: '1321873316', siteurl: 'http://www.moskva.fm/',
playerxml: 'player_xml.html', flxml: 'flxml.html', registerurl: 'register/', lostpassurl: 'lostpassword/'}}
, {{bgcolor:'', wmode: 'window'}})
</script>
", id, time));
        }
    }
}